package com.spring.hotel.controller;

import com.spring.hotel.common.JsonResponse;
import com.spring.hotel.entity.Checkout;
import com.spring.hotel.entity.Comments;
import com.spring.hotel.entity.Drinks;
import com.spring.hotel.entity.PageDTO;
import com.spring.hotel.service.CheckoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hotel/checkout")
public class CheckoutController {
    @Autowired
    private CheckoutService checkoutService;

    //列表展示
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public JsonResponse list(Checkout checkout, PageDTO pageDTO) {
        return checkoutService.pageList(checkout,pageDTO);
    }

    //添加退房记录
    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    public JsonResponse insert(@RequestBody Checkout checkout) {
        return checkoutService.insertCheckout(checkout);
    }
}
